<template>
    <div class="home">
        this is home
        ps:{{$route.query.ps}}
        {{$store.state.userName}}
        {{computePassword}}

        <button @click="chnagePassword">修改vuex密码</button>
    </div>
</template>

<script>

export default {
  name: 'home',
  data () {
     return {msg:'fdf'}
  },
  created(){
     console.log(this.$router);
     console.log(this.$route);
  },
  computed:{
      computePassword(){
          return this.$store.state.password;
      }
  },
  methods:{
      chnagePassword(){
          this.$store.commit({
              type:'chnagePassword',
              oldPassword:'admin',
              newPassword:'admin888'
          });
      }
  }
}
</script>

<style lang="scss" scoped>
   button{
       border-radius: 5px;
       display:flex;
   }
</style>
